/**
 * ChronosPanel.java
 *
 * Copyright (c) 2011 Daniel Berenguer <dberenguer@usapiens.com>
 *
 * This file is part of the panStamp project.
 *
 * panStamp  is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * any later version.
 *
 * panLoader is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with panLoader; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
 * USA
 *
 * Author: Daniel Berenguer
 * Creation date: 06/15/2011
 */

package swapdmt;

import chronos.ChronosWatch;
import swap.SwapValue;

/**
 *
 * @author daniel
 */
public class ChronosPanel extends javax.swing.JPanel {

  /** Creates new form ChronosPanel */
  public ChronosPanel()
  {
    initComponents();

    jPanelPage0.setLayout(new java.awt.BorderLayout());
    page0 = new ChronosPagePanel();
    jPanelPage0.add(page0);

    jPanelPage1.setLayout(new java.awt.BorderLayout());
    page1 = new ChronosPagePanel();
    jPanelPage1.add(page1);

    jPanelPage2.setLayout(new java.awt.BorderLayout());
    page2 = new ChronosPagePanel();
    jPanelPage2.add(page2);

    jPanelPage3.setLayout(new java.awt.BorderLayout());
    page3 = new ChronosPagePanel();
    jPanelPage3.add(page3);

    jPanelPage4.setLayout(new java.awt.BorderLayout());
    page4 = new ChronosPagePanel();
    jPanelPage4.add(page4);
  }

  /** This method is called from within the constructor to
   * initialize the form.
   * WARNING: Do NOT modify this code. The content of this method is
   * always regenerated by the Form Editor.
   */
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    jLabel1 = new javax.swing.JLabel();
    jComboTimeHour = new javax.swing.JComboBox();
    jLabel2 = new javax.swing.JLabel();
    jComboTimeMin = new javax.swing.JComboBox();
    jLabel3 = new javax.swing.JLabel();
    jLabel4 = new javax.swing.JLabel();
    jComboAlarmHour = new javax.swing.JComboBox();
    jLabel5 = new javax.swing.JLabel();
    jComboAlarmMin = new javax.swing.JComboBox();
    jLabel7 = new javax.swing.JLabel();
    jTextTemperature = new javax.swing.JTextField();
    jLabel8 = new javax.swing.JLabel();
    jTextAltitude = new javax.swing.JTextField();
    jTabbedPanePages = new javax.swing.JTabbedPane();
    jPanelPage0 = new javax.swing.JPanel();
    jPanelPage1 = new javax.swing.JPanel();
    jPanelPage2 = new javax.swing.JPanel();
    jPanelPage3 = new javax.swing.JPanel();
    jPanelPage4 = new javax.swing.JPanel();
    jLabel9 = new javax.swing.JLabel();
    jComboDay = new javax.swing.JComboBox();
    jLabel6 = new javax.swing.JLabel();
    jComboMonth = new javax.swing.JComboBox();
    jComboYear = new javax.swing.JComboBox();
    jCheckBoxMetrics = new javax.swing.JCheckBox();
    jComboPeriod = new javax.swing.JComboBox();
    jLabel10 = new javax.swing.JLabel();

    setName("Form"); // NOI18N

    org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(swapdmt.SWAPdmtApp.class).getContext().getResourceMap(ChronosPanel.class);
    jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
    jLabel1.setName("jLabel1"); // NOI18N

    jComboTimeHour.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23" }));
    jComboTimeHour.setName("jComboTimeHour"); // NOI18N

    jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
    jLabel2.setName("jLabel2"); // NOI18N

    jComboTimeMin.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59" }));
    jComboTimeMin.setName("jComboTimeMin"); // NOI18N

    jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
    jLabel3.setName("jLabel3"); // NOI18N

    jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
    jLabel4.setName("jLabel4"); // NOI18N

    jComboAlarmHour.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23" }));
    jComboAlarmHour.setName("jComboAlarmHour"); // NOI18N

    jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
    jLabel5.setName("jLabel5"); // NOI18N

    jComboAlarmMin.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59" }));
    jComboAlarmMin.setName("jComboAlarmMin"); // NOI18N

    jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
    jLabel7.setName("jLabel7"); // NOI18N

    jTextTemperature.setText(resourceMap.getString("jTextTemperature.text")); // NOI18N
    jTextTemperature.setName("jTextTemperature"); // NOI18N

    jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N
    jLabel8.setName("jLabel8"); // NOI18N

    jTextAltitude.setText(resourceMap.getString("jTextAltitude.text")); // NOI18N
    jTextAltitude.setName("jTextAltitude"); // NOI18N

    jTabbedPanePages.setName("jTabbedPanePages"); // NOI18N

    jPanelPage0.setName("jPanelPage0"); // NOI18N

    javax.swing.GroupLayout jPanelPage0Layout = new javax.swing.GroupLayout(jPanelPage0);
    jPanelPage0.setLayout(jPanelPage0Layout);
    jPanelPage0Layout.setHorizontalGroup(
      jPanelPage0Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGap(0, 503, Short.MAX_VALUE)
    );
    jPanelPage0Layout.setVerticalGroup(
      jPanelPage0Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGap(0, 171, Short.MAX_VALUE)
    );

    jTabbedPanePages.addTab(resourceMap.getString("jPanelPage0.TabConstraints.tabTitle"), jPanelPage0); // NOI18N

    jPanelPage1.setName("jPanelPage1"); // NOI18N

    javax.swing.GroupLayout jPanelPage1Layout = new javax.swing.GroupLayout(jPanelPage1);
    jPanelPage1.setLayout(jPanelPage1Layout);
    jPanelPage1Layout.setHorizontalGroup(
      jPanelPage1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGap(0, 503, Short.MAX_VALUE)
    );
    jPanelPage1Layout.setVerticalGroup(
      jPanelPage1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGap(0, 171, Short.MAX_VALUE)
    );

    jTabbedPanePages.addTab(resourceMap.getString("jPanelPage1.TabConstraints.tabTitle"), jPanelPage1); // NOI18N

    jPanelPage2.setName("jPanelPage2"); // NOI18N

    javax.swing.GroupLayout jPanelPage2Layout = new javax.swing.GroupLayout(jPanelPage2);
    jPanelPage2.setLayout(jPanelPage2Layout);
    jPanelPage2Layout.setHorizontalGroup(
      jPanelPage2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGap(0, 503, Short.MAX_VALUE)
    );
    jPanelPage2Layout.setVerticalGroup(
      jPanelPage2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGap(0, 171, Short.MAX_VALUE)
    );

    jTabbedPanePages.addTab(resourceMap.getString("jPanelPage2.TabConstraints.tabTitle"), jPanelPage2); // NOI18N

    jPanelPage3.setName("jPanelPage3"); // NOI18N

    javax.swing.GroupLayout jPanelPage3Layout = new javax.swing.GroupLayout(jPanelPage3);
    jPanelPage3.setLayout(jPanelPage3Layout);
    jPanelPage3Layout.setHorizontalGroup(
      jPanelPage3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGap(0, 503, Short.MAX_VALUE)
    );
    jPanelPage3Layout.setVerticalGroup(
      jPanelPage3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGap(0, 171, Short.MAX_VALUE)
    );

    jTabbedPanePages.addTab(resourceMap.getString("jPanelPage3.TabConstraints.tabTitle"), jPanelPage3); // NOI18N

    jPanelPage4.setName("jPanelPage4"); // NOI18N

    javax.swing.GroupLayout jPanelPage4Layout = new javax.swing.GroupLayout(jPanelPage4);
    jPanelPage4.setLayout(jPanelPage4Layout);
    jPanelPage4Layout.setHorizontalGroup(
      jPanelPage4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGap(0, 503, Short.MAX_VALUE)
    );
    jPanelPage4Layout.setVerticalGroup(
      jPanelPage4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGap(0, 171, Short.MAX_VALUE)
    );

    jTabbedPanePages.addTab(resourceMap.getString("jPanelPage4.TabConstraints.tabTitle"), jPanelPage4); // NOI18N

    jLabel9.setText(resourceMap.getString("jLabel9.text")); // NOI18N
    jLabel9.setName("jLabel9"); // NOI18N

    jComboDay.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31" }));
    jComboDay.setName("jComboDay"); // NOI18N

    jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
    jLabel6.setName("jLabel6"); // NOI18N

    jComboMonth.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }));
    jComboMonth.setName("jComboMonth"); // NOI18N

    jComboYear.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "2011", "2012", "2013", "2014", "2015", "2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023", "2024", "2025" }));
    jComboYear.setName("jComboYear"); // NOI18N

    jCheckBoxMetrics.setSelected(true);
    jCheckBoxMetrics.setText(resourceMap.getString("jCheckBoxMetrics.text")); // NOI18N
    jCheckBoxMetrics.setName("jCheckBoxMetrics"); // NOI18N

    jComboPeriod.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60" }));
    jComboPeriod.setName("jComboPeriod"); // NOI18N

    jLabel10.setText(resourceMap.getString("jLabel10.text")); // NOI18N
    jLabel10.setName("jLabel10"); // NOI18N

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
          .addComponent(jTabbedPanePages, javax.swing.GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
          .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
              .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                  .addGroup(layout.createSequentialGroup()
                    .addComponent(jLabel1)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jComboTimeHour, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                  .addGroup(layout.createSequentialGroup()
                    .addComponent(jLabel4)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jComboAlarmHour, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(4, 4, 4)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                  .addGroup(layout.createSequentialGroup()
                    .addComponent(jLabel2)
                    .addGap(6, 6, 6)
                    .addComponent(jComboTimeMin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                  .addGroup(layout.createSequentialGroup()
                    .addComponent(jLabel5)
                    .addGap(6, 6, 6)
                    .addComponent(jComboAlarmMin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
              .addComponent(jCheckBoxMetrics))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                .addGroup(layout.createSequentialGroup()
                  .addComponent(jLabel6)
                  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                  .addComponent(jLabel7))
                .addGroup(layout.createSequentialGroup()
                  .addComponent(jLabel3)
                  .addGap(18, 18, 18)
                  .addComponent(jLabel9)
                  .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                  .addComponent(jComboDay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
              .addComponent(jLabel8, javax.swing.GroupLayout.Alignment.TRAILING))
            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(layout.createSequentialGroup()
                .addComponent(jComboMonth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                  .addComponent(jComboYear, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel10)
                    .addComponent(jComboPeriod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
              .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                .addComponent(jTextAltitude, javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jTextTemperature, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 76, Short.MAX_VALUE)))))
        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
    layout.setVerticalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel1)
          .addComponent(jLabel2)
          .addComponent(jComboTimeMin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(jLabel3)
          .addComponent(jLabel9)
          .addComponent(jComboDay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(jComboMonth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(jComboYear, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(jComboTimeHour, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
          .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
            .addComponent(jLabel4)
            .addComponent(jComboAlarmHour, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addComponent(jLabel5)
            .addComponent(jComboAlarmMin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addComponent(jLabel6)
            .addComponent(jTextTemperature, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addComponent(jLabel7))
          .addComponent(jLabel10))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jTextAltitude, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(jLabel8)
          .addComponent(jCheckBoxMetrics)
          .addComponent(jComboPeriod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addGap(18, 18, 18)
        .addComponent(jTabbedPanePages, javax.swing.GroupLayout.PREFERRED_SIZE, 214, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addContainerGap(30, Short.MAX_VALUE))
    );
  }// </editor-fold>//GEN-END:initComponents


  // Variables declaration - do not modify//GEN-BEGIN:variables
  private javax.swing.JCheckBox jCheckBoxMetrics;
  private javax.swing.JComboBox jComboAlarmHour;
  private javax.swing.JComboBox jComboAlarmMin;
  private javax.swing.JComboBox jComboDay;
  private javax.swing.JComboBox jComboMonth;
  private javax.swing.JComboBox jComboPeriod;
  private javax.swing.JComboBox jComboTimeHour;
  private javax.swing.JComboBox jComboTimeMin;
  private javax.swing.JComboBox jComboYear;
  private javax.swing.JLabel jLabel1;
  private javax.swing.JLabel jLabel10;
  private javax.swing.JLabel jLabel2;
  private javax.swing.JLabel jLabel3;
  private javax.swing.JLabel jLabel4;
  private javax.swing.JLabel jLabel5;
  private javax.swing.JLabel jLabel6;
  private javax.swing.JLabel jLabel7;
  private javax.swing.JLabel jLabel8;
  private javax.swing.JLabel jLabel9;
  private javax.swing.JPanel jPanelPage0;
  private javax.swing.JPanel jPanelPage1;
  private javax.swing.JPanel jPanelPage2;
  private javax.swing.JPanel jPanelPage3;
  private javax.swing.JPanel jPanelPage4;
  private javax.swing.JTabbedPane jTabbedPanePages;
  private javax.swing.JTextField jTextAltitude;
  private javax.swing.JTextField jTextTemperature;
  // End of variables declaration//GEN-END:variables

  private ChronosPagePanel page0;
  private ChronosPagePanel page1;
  private ChronosPagePanel page2;
  private ChronosPagePanel page3;
  private ChronosPagePanel page4;

  /**
   * getDateTimeString
   *
   * Return Date/Time SwapValue, ready to be sent to the Chronos
   */
  public SwapValue getDateTimeString()
  {
    int[] arr = new int[7];

    arr[0] = Integer.parseInt((String)jComboTimeHour.getSelectedItem());
    arr[1] = Integer.parseInt((String)jComboTimeMin.getSelectedItem());
    arr[2] = 0x00;
    int year = Integer.parseInt((String)jComboYear.getSelectedItem());
    arr[3] = year >> 8;
    arr[4] = year & 0xFF;
    arr[5] = jComboMonth.getSelectedIndex() + 1;
    arr[6] = Integer.parseInt((String)jComboDay.getSelectedItem());

    return new SwapValue(arr);
  }

  /**
   * getAlarmString
   *
   * Return Alarm SwapValue, ready to be sent to the Chronos
   */
  public SwapValue getAlarmString()
  {
    int[] arr = new int[2];

    arr[0] = Integer.parseInt((String)jComboAlarmHour.getSelectedItem());
    arr[1] = Integer.parseInt((String)jComboAlarmMin.getSelectedItem());

    return new SwapValue(arr);
  }

  /**
   * getCalibration
   *
   * Return calibration SwapValue, ready to be sent to the Chronos
   */
  public SwapValue getCalibration()
  {
    int[] arr = new int[5];

    // Use Metrics option
    if (jCheckBoxMetrics.isSelected())
      arr[0] = 0x01;
    else
      arr[0] = 0x00;

    // Temperature
    String buf = jTextTemperature.getText();
    if (buf.equals(""))
      return null;
    String buf2;
    int decPos = buf.indexOf('.');
    if (decPos == -1)
    {
      arr[1] = 0;
      arr[2] = Integer.parseInt(buf);
    }
    else
    {
      buf2 = buf.substring(decPos+1);
      if (buf2.equals(""))
      {
        arr[1] = 0;
        arr[2] = Integer.parseInt(buf);
      }
      else
      {
        int val = Integer.parseInt(buf2.substring(0, 1)) + 10 * Integer.parseInt(buf.substring(0, decPos));
        arr[1] = val >> 8;
        arr[2] = val & 0xFF;
      }
    }

    // Altitude
    buf = (String)jTextAltitude.getText();
    int val;
    if (buf.equals(""))
      val = 0;
    else
      val = Integer.parseInt(buf);
    arr[3] = val >> 8;
    arr[4] = val & 0xFF;

    return new SwapValue(arr);
  }

  /**
   * getTxPeriod
   *
   * Return Period SwapValue, ready to be sent to the Chronos
   */
  public SwapValue getTxPeriod()
  {
    return new SwapValue(jComboPeriod.getSelectedIndex(), 1);
  }

  /**
   * getPage
   *
   * Return Page SwapValue, ready to be sent to the Chronos
   *
   * 'page'   Index of page
   */
  public SwapValue getPage(int page)
  {
    switch (page)
    {
      case 0:
        return page0.getPage();
      case 1:
        return page1.getPage();
      case 2:
        return page2.getPage();
      case 3:
        return page3.getPage();
      case 4:
        return page4.getPage();
      default:
        return null;
    }
  }

  /**
   * getNumberOfPages
   *
   * Return the amount of pages configurable in the Chronos
   */
  public int getNumberOfPages()
  {
    return ChronosWatch.NUMBER_OF_PAGES;
  }
}
